<?php 
 class Categories extends CI_Model{
    function __construct(){
        parent::__construct();
    }
    /**
     * Get options
     * @author tien.nguyen
     */
    public function getOptions(){
        $this->db->select('categories.CategoryId, categories.CategoryName');
        $this->db->from('categories');
        $query = $this->db->get();
        $list = $query->result();
        $res = array();
        foreach($list as $item){
            $res[$item->CategoryId] = $item->CategoryName;
        }
        return $res;
    }
 }